package com.evil.application.pojo.dto.reporting;

import cn.hutool.core.collection.CollUtil;
import com.evil.common.application.dto.judge.JudgeAnd;
import com.evil.common.application.dto.judge.JudgeOr;
import jakarta.validation.Valid;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @author liyang
 * @date 2023-10-07 20:35
 */
@Data
public class FilterConfigDTO {

    /**
     * 或条件列表
     */
    @Valid
    private List<JudgeOr> judgeOrs;

    public FilterConfigDTO() {
        this.judgeOrs = new ArrayList<>();
    }

    public FilterConfigDTO(List<JudgeOr> judgeOrs) {
        this.judgeOrs = judgeOrs;
    }

    public FilterConfigDTO(JudgeAnd... judgeAnds) {
        this.judgeOrs = CollUtil.toList(new JudgeOr(CollUtil.toList(judgeAnds)));
    }
}
